import request from '@/utils/request'

// 查询事项列表
export function listApp(query) {
  return request({
    url: '/flowable/app/list',
    method: 'get',
    params: query
  })
}

// 查询事项详细
export function getApp(appId) {
  return request({
    url: '/flowable/app/' + appId,
    method: 'get'
  })
}

// 新增事项
export function addApp(data) {
  return request({
    url: '/flowable/app',
    method: 'post',
    data: data
  })
}

// 修改事项
export function updateApp(data) {
  return request({
    url: '/flowable/app',
    method: 'put',
    data: data
  })
}

// 删除事项
export function delApp(appId) {
  return request({
    url: '/flowable/app/' + appId,
    method: 'delete'
  })
}


// 更新状态
export function updateStatus(id) {
  return request({
    url: '/flowable/app/updateStatus/' + id,
    method: 'get'
  })
}

// 获取表单列表
export function getFormList() {
  return request({
    url: '/flowable/app/getFormList',
    method: 'get'
  })
}

// 获取表单版本列表
export function getFormVersionList(formId) {
  return request({
    url: '/flowable/app/getFormVersionList/'+ formId,
    method: 'get'
  })
}
